package com.qfjy.controller;

import com.qfjy.service.impl.VideoInfoServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("videoInfo")
@Slf4j
public class VideoInfoController {


    @Value("${server.port}")
    private int port;
    @Autowired
    private VideoInfoServiceImpl videoInfoService;


    /**
     * TODO 根据会议编号 查询视频相关信息
     *   url:  videoInfo/select?pcode=1111
     * @param pcode
     * @return
     */
    @GetMapping("select")
    @ResponseBody
    public String selectVideoInfoByPcode(@RequestParam("pcode") String pcode){

      String result=  videoInfoService.selectVideoInfoByPcode(pcode);
        log.info("查询的是视频微服务{}",result);
        return result+"\t"+port;
    }
}
